<!DOCTYPE html>
<html>
<head>
    <title>年度计划评审下发</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="计划名称"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("devequfile:temporary"))
                <i-button type="success" @click="temporary"><i class="fa fa-pencil-square-o"></i>&nbsp;新增检修计划</i-button>
                #end
                <!--                #if($shiro.hasPermission("devequfile:startDate"))-->
                <!--                <i-button type="success" @click="endPlan"><i class="fa fa-gavel"></i>&nbsp;结束计划</i-button>-->
                <!--                #end-->
                <!--                #if($shiro.hasPermission("devequfile:startDate"))-->
                <!--                <i-button type="text" @click="startDate"><i class="fa fa-bell-o"></i>&nbsp;开始执行</i-button>-->
                <!--                #end-->
                <!--                #if($shiro.hasPermission("devequfile:abnormalReport"))-->
                <!--                <i-button type="warning" @click="abnormalReport"><i class="fa fa-cog"></i>&nbsp;异常提报</i-button>-->
                <!--                #end-->
                <!--                #if($shiro.hasPermission("devequfile:queryError"))-->
                <!--                <i-button type="info" @click="queryError"><i class="fa fa-circle-o"></i>&nbsp;查看异常</i-button>-->
                <!--                #end-->
                <!--                #if($shiro.hasPermission("devequfile:extension"))-->
                <!--                <i-button type="default" @click="extension"><i class="fa fa-eercast"></i>&nbsp;计划申请</i-button>-->
                <!--                #end-->
                <!--                #if($shiro.hasPermission("devequfile:extensionApproval"))-->
                <!--                <i-button type="primary" @click="extensionApproval"><i class="fa fa-ravelry"></i>&nbsp;计划审批</i-button>-->
                <!--                #end-->
                <!--                #if($shiro.hasPermission("devequfile:assignment"))-->
                <!--                <i-button type="info" @click="assignment"><i class="fa fa-code-fork"></i>&nbsp;分派</i-button>-->
                <!--                #end-->
                <!--                #if($shiro.hasPermission("devequfile:reviewAndLower"))-->
                <!--                <i-button type="success" @click="reviewAndLower"><i class="fa fa-long-arrow-down"></i>&nbsp;评审并下发-->
                <!--                </i-button>-->
                <!--                #end-->
                #if($shiro.hasPermission("devequfile:add"))
                <i-button type="warning" @click="add"><i class="fa fa-pencil-square-o"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("devequfile:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
                #if($shiro.hasPermission("maintainplan:apply"))
                <i-button type="info" @click="apply"><i class="fa fa-trash-o"></i>&nbsp;审核</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>
    <Card id ="temporary" v-show="temporaryShow">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="devMaintenPlan" :rules="ruleValidate" :label-width="100">
            <Row>
                <i-col span="11">
                    <Form-item label="设备编码" prop="devCode">
                        <i-input v-model="devMaintenPlan.devCode" icon="md-arrow-dropdown-circle" @on-click="getDeviceInfo"
                                 readonly placeholder="设备编码"/>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="版本" prop="planVersion">
                        <i-input v-model="devMaintenPlan.planVersion" placeholder="版本"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="实施频率 " prop="freRate"><!-- 0每天 1每周 2每个月 3每个季度 4每半年 5一年-->
                        <i-select v-model="devMaintenPlan.freRate" placeholder="实施频率">
                            <i-option v-for="item in freRateArray" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="检查时间" prop="checkDatePrud">
                        <Radio-group v-model="devMaintenPlan.checkDatePrud">
                            <Radio :label="0">
                                <span>非生产</span>
                            </Radio>
                            <Radio :label="1">
                                <span>生产</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                </i-col>
            </Row>
            <Row>

                <i-col span="11">
                    <Form-item label="人次" prop="perEv">
                        <i-input v-model="devMaintenPlan.perEv" placeholder="人次"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="内容" prop="planCon">
                        <i-input v-model="devMaintenPlan.planCon" placeholder="内容" type="textarea"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>

                <i-col span="11">
                    <Form-item label="类型" prop="reserve1">
                        <i-select v-model="devMaintenPlan.reserve1">
                            <i-option v-for="type in typeList" :value="type.value" :key="type.value">{{type.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>

            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit2('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">
                    返回
                </i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置
                </i-button>
            </Form-item>
        </i-form>
    </Card>
    <Card id="addTab" v-show="!addTab">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate1" :model="maintainplan" :rules="ruleValidate1" :label-width="100">
            <Row>
                <i-col span="11">
                    <Form-item label="计划名称" prop="planName">
                        <i-input v-model="maintainplan.planName" class="form-input" ></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="选择规程" prop="ruleName">
                        <i-input v-model="maintainplan.ruleName"  icon="md-arrow-dropdown-circle"  readonly="readonly"
                                 @on-click="getPlan" class="form-input" ></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="计划开始时间" prop="carryDate">
                        <Date-picker :options="options" type="datetime" v-model="maintainplan.carryDate" class="form-input" ></Date-picker>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="计划结束时间" prop="completeDate">
                        <Date-picker   type="datetime" v-model="maintainplan.completeDate" class="form-input" ></Date-picker>
                    </Form-item>
                </i-col>
            </Row>

        <Form-item>
            <i-button type="primary" @click="handleSubmit('formValidate1')">提交</i-button>
            <i-button type="warning" @click="reload2" style="margin-left: 8px">返回</i-button>
            <i-button type="info" @click="handleReset('formValidate1')" style="margin-left: 8px">重置</i-button>
        </Form-item>
        </i-form>
    </Card>

    <div id="reviewData" v-show="!reviewData">
        <i-form ref="reviewValue" :rules="ruleInline" :label-width="100">
            <Form-item label="计划名称" prop="name">
                <i-input v-model="reviewValue.name" class="form-input" disabled="disabled"></i-input>
            </Form-item>
            <Form-item label="评审" prop="review">
                <i-input v-model="reviewValue.review" type="textarea" :autosize="{ minRows: 6, maxRows: 6}"
                         class="form-input"
                         placeholder="评审内容"></i-input>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="reviewClick">查看维护规程信息</i-button>
            </Form-item>
        </i-form>
    </div>
    <div id="apply" style="display: none;">
        <form class="form-horizontal" style="width: 350px;">
            <div class="form-group">
                <div class="form-group">
                    <div class="col-sm-3 control-label" style="width: 28%;">审核状态</div>
                    <div class="col-sm-8" style="margin-top: 6px">
                        <Radio-group v-model="maintainplan.approvalStatus">
                            <Radio :label="1"><span>通过</span></Radio>
                            <Radio :label="2"><span>不通过</span></Radio>
                        </Radio-group>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <div id="assignment" v-show="assignmentShow">
        <i-form ref="assignmentData" :rules="assignmentInline" :label-width="100">
            <Form-item label="计划名称" prop="name">
                <i-input v-model="assignmentData.name" class="form-input" disabled></i-input>
            </Form-item>
            <Form-item label="评审内容" prop="review">
                <i-input v-model="assignmentData.review" type="textarea" :autosize="{ minRows: 6, maxRows: 6}"
                         class="form-input" disabled placeholder="评审内容"></i-input>
            </Form-item>
            <Form-item label="主修人员" prop="carryName">
                <i-select v-model="assignmentData.carryName" class="form-input" @on-change="carryClick">
                    <i-option v-for="item in cityList" :value="item.USER_NAME" :key="item">{{ item.USER_NAME }}
                    </i-option>
                </i-select>
            </Form-item>
            <Form-item label="辅修人员" prop="planPerson">
                <Checkbox-group v-model="checkAllGroup">
                    <Checkbox v-for="item in planPerson" :label="item.USER_NAME"></Checkbox>
                </Checkbox-group>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="assignmentClick">查看维护规程信息</i-button>
            </Form-item>
        </i-form>
    </div>


    <div id="planApply" style="display: none">
        <i-form ref="planApplyData" :rules="planApplyValidate" :label-width="100">
            <Form-item label="计划名称" prop="planName">
                <i-input v-model="planApplyData.planName" class="form-input" disabled></i-input>
            </Form-item>
            <Form-item label="原因" prop="reason">
                <i-input v-model="planApplyData.reason" class="form-input" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }"></i-input>
            </Form-item>
            <Form-item label="事项" prop="matter">
                <i-input v-model="planApplyData.matter" class="form-input" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }"></i-input>
            </Form-item>
            <Form-item label="类型" prop="planApplyType">
                <i-select v-model="planApplyData.type" class="form-input">
                    <i-option v-for="item in planApplyTypeList" :value="item.value" :key="item">{{ item.label }}</i-option>
                </i-select>
            </Form-item>
        </i-form>
    </div>

    <div id="abnormalGrid" style="display: none">
        <i-form ref="abnormaData" :rules="abnormaInline" :label-width="100">
            <Form-item label="异常来源" prop="abnormalSources">
                <i-select v-model="abnormaData.abnormalSources" class="form-input">
                    <i-option v-for="item in abnormaSourceList" :value="item.value" :key="item">{{ item.label }}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="设备名称" prop="equipmentId">
                <i-select v-model="abnormaData.equipmentId" class="form-input">
                    <i-option v-for="item in equipmentNameList" :value="item.ID" :key="item.ID">{{ item.DEV_NAME }}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="生产线" prop="productionLine">
                <i-input v-model="abnormaData.productionLineName" disabled @on-click="deptTreeShow" class="form-input" icon="fa fa-deafness"></i-input>
            </Form-item>
            <Form-item label="工位序号" prop="stationNumber">
                <i-input v-model="abnormaData.stationNumber" class="form-input" type="number"></i-input>
            </Form-item>
            <Form-item label="工位名称" prop="stationName">
                <i-input v-model="abnormaData.stationName" class="form-input"></i-input>
            </Form-item>
            <Form-item label="异常现象" prop="abnormalNow">
                <i-input v-model="abnormaData.abnormalNow" class="form-input" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }"></i-input>
            </Form-item>
            <Form-item label="问题描述" prop="problemDescribe">
                <i-input v-model="abnormaData.problemDescribe" class="form-input" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }"></i-input>
            </Form-item>
            <Form-item label="建议" prop="proposal">
                <i-input v-model="abnormaData.proposal" class="form-input" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }"></i-input>
            </Form-item>
        </i-form>
    </div>


    <div id="maintenanceProcedure" style="display: none">
        <i-table border :columns="columns1" :data="data1"></i-table>
    </div>

    <div id="planChangeTable" style="display: none">
        <i-table border :columns="columns2" :data="data2"></i-table>
    </div>

    <div id="queryError" style="display: none">
        <i-table border :columns="columns3" :data="data3"></i-table>
    </div>
    <div id="categoryLayer" style="display: none;padding:10px;">
        <ul id="categoryTree" class="ztree"></ul>
    </div>
</div>
</body>
<script src="${rc.contextPath}/js/sys/yearMaintainPlan.js?_${date.systemTime}"></script>
</html>
<style>
    .form-input {
        width: 90%;
        padding-top: 0.5%;
    }
</style>
